package GUI;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

/**
 * @author Martin
 * @version 1.0
 * @created 14-III-2012 13:12:27
 */
public abstract class AObserver{

        protected JFrame okno;
        protected JLabel parserCinnost;
        protected JPanel parserPanel;
	public AObserver(){
	}

	/**
	 * 
	 * @param message
	 */
	public void messageOperation(String message){
            JOptionPane.showMessageDialog(okno, message, "Operační chyba", JOptionPane.WARNING_MESSAGE);
	}

        public void messageDatabaze(String message){
            JOptionPane.showMessageDialog(okno, message, "Chyba DB", JOptionPane.ERROR_MESSAGE);
	}
        
        public void messageInvalidDate(String message){
            JOptionPane.showMessageDialog(okno, message, "Chyba data", JOptionPane.WARNING_MESSAGE);
	}
	/**
	 * 
	 * @param message
	 */
	public void messageParser(String message){
            parserPanel.setVisible(false);
            //parserCinnost.removeAll();
            //parserCinnost.setText("");
            parserCinnost.setText(message);
            parserPanel.revalidate();
            parserPanel.setVisible(true);
	}
        
        // pouzijeme k upozorneni gui o zmene v result data
        abstract public void update();

}